package com.yumeng.framework.persistence.mybatis.injector;

/**
 * @author wxd
 * @date 2021/12/14 22:20
 */
public enum MySqlMethod {

    INSERT_BATCH("insertBatch", "批量插入数据", "<script>\nINSERT INTO %s %s VALUES %s\n</script>"),
    UPDATE_BATCH_BY_IDS("updateBatchIds", "批量更新数据", "<script>\n%s\n</script>"),

    LOGIC_DELETE("logicDelete", "根据entity条件逻辑删除记录", "<script>\nUPDATE %s %s %s %s\n</script>"),
    LOGIC_DELETE_BY_MAP("logicDeleteByMap", "根据columnMap条件逻辑删除记录", "<script>\nUPDATE %s %s %s\n</script>"),
    LOGIC_DELETE_BY_ID("logicDeleteById", "根据ID逻辑删除一条数据", "<script>\nUPDATE %s %s WHERE %s=#{%s} %s\n</script>"),
    LOGIC_DELETE_BY_IDS("logicDeleteByIds", "根据ID集合逻辑批量删除数据", "<script>\nUPDATE %s %s WHERE %s IN (%s) %s\n</script>");

    private final String method;
    private final String desc;
    private final String sql;

    MySqlMethod(String method, String desc, String sql) {
        this.method = method;
        this.desc = desc;
        this.sql = sql;
    }

    public String getMethod() {
        return method;
    }

    public String getDesc() {
        return desc;
    }

    public String getSql() {
        return sql;
    }
}
